package com.lzy.cloud.order.service.impl;

import com.lzy.cloud.order.dtos.OrderCarRentMoneyDto;
import com.lzy.cloud.order.entity.OrderCarRentMoney;
import com.lzy.cloud.order.mapper.OrderCarRentMoneyMapperExt;
import com.lzy.cloud.order.service.OrderCarRentMoneyService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:房车租赁的价格明细
 * @author: liyun
 * @create: 2018-07-05 16:10
 */
@Service
public class OrderCarRentMoneyServiceImpl implements OrderCarRentMoneyService {
    @Autowired
    private OrderCarRentMoneyMapperExt orderCarRentMoneyMapperExt;

    @Override
    public List<OrderCarRentMoneyDto> queryList(OrderCarRentMoneyDto orderCarRentMoneyDto) {
        return orderCarRentMoneyMapperExt.queryList(orderCarRentMoneyDto);
    }

    @Override
    public Long create(OrderCarRentMoneyDto orderCarRentMoneyDto) {
        OrderCarRentMoney orderCarRentMoney = DozerUtils.map(orderCarRentMoneyDto, OrderCarRentMoney.class);
        return orderCarRentMoneyMapperExt.insertSelective(orderCarRentMoney)>0 ? orderCarRentMoney.getId() : 0;
    }
}
